package com.ziqikeji.xianyan.common;

import com.ziqikeji.xianyan.enumeration.DeleteFlagEnum;
import com.ziqikeji.xianyan.enumeration.YesOrNoEnum;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.NoRepositoryBean;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.io.Serializable;
import java.util.List;

/**
 * @author liuyu
 */
@NoRepositoryBean
public interface BaseDao<T, ID extends Serializable> extends PagingAndSortingRepository<T, ID>{

    /**
     * 获取未删除数据
     *
     * @param deleteFlagEnum 删除性标记
     * @return T
     */
    List<T> findByDeleteFlagEnum(DeleteFlagEnum deleteFlagEnum);

    /**
     * 获取未删除数据（含分页信息）
     *
     * @param deleteFlagEnum 删除性标记
     *
     *@param pageable       分页信息  @return
     */
    Page<T> queryByDeleteFlagEnum(DeleteFlagEnum deleteFlagEnum,Pageable pageable);


}
